package stark.app.kit;

import androidx.annotation.NonNull;

import android.util.Log;
import android.view.View;
import android.widget.Toast;

import com.chad.library.adapter.base.BaseQuickAdapter;

import stark.app.MainBaseFragment;
import stark.app.frame.TextItemBean;
import stark.common.basic.device.DeviceInfoUtil;
import stark.common.basic.utils.AESUtil;
import stark.common.basic.utils.AppUtil;
import stark.common.basic.utils.DensityUtil;
import stark.common.basic.utils.LogUtil;

public class KitFragment extends MainBaseFragment {
    private static final String TAG = "KitFragment";
    String mContent = "83d67430e2bd9541b6bd1f02fa858448be69527209302945d1856e17455fba856cdee81a09bc321bec02ba6e97f16b68f6eb4487ee9b78106e22e0c45f761bcd6aea2bdd735179563e102a9bf828ff0b690b92e680f95d396de91c46b96b296b";



    @Override
    public void addDefaultData() {
        mAdapter.addData(new TextItemBean("AESUtil"));
        mAdapter.addData(new TextItemBean("AppUtil"));
        mAdapter.addData(new TextItemBean("DataUtil"));
        mAdapter.addData(new TextItemBean("DensityUtil"));
        mAdapter.addData(new TextItemBean("FileUtil"));
        mAdapter.addData(new TextItemBean("IntentUtil"));
        mAdapter.addData(new TextItemBean("RegExpValidatorUtil"));
        mAdapter.addData(new TextItemBean("SPUtil"));
        mAdapter.addData(new TextItemBean("TimeUtil"));
        mAdapter.addData(new TextItemBean("UriUtil"));

    }

    @Override
    public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
        Toast.makeText(mContext, "请看log日志", Toast.LENGTH_SHORT).show();
        switch (position){
            case 0:
                Log.e(TAG,"AESUtil:AES解密 "+ AESUtil.decrypt(mContent));
                break;
            case 1:
                Log.e(TAG, "AppUtil:版本名称 "+ AppUtil.getVersionName(mContext)+"\n版本号"+
                        AppUtil.getVersionCode(mContext));
                break;
            case 2:
                Log.e(TAG, "DataUtil: 请看类文档" );
                break;
            case 3:
                Log.e(TAG, "DensityUtil: 屏幕宽度"+ DensityUtil.getWith(mContext)+
                        "  屏幕高度"+DensityUtil.getHeight(mContext)+
                        "  状态栏高度"+DensityUtil.getStatusBarHeight(mContext)+
                        "屏幕高宽比"+ DeviceInfoUtil.getHWRate(DeviceInfoUtil.getDeviceHeight(mContext),DeviceInfoUtil.getDeviceWidth(mContext))+
                        "  dp与像素转换功能略");

                break;
            case 4:

                break;
            case 5:

                break;
            case 6:

                break;
        }
    }
}